package com.geekchique.runningbuddy.model;

import java.util.Vector;
import java.util.TreeMap;
import java.util.Iterator;

import android.location.Location;

public class Route {
	protected Vector<Location> locations;
	
	public Route()
	{
		locations = new Vector<Location>();
	}
	
	public void addPoint(Location loc)
	{
		locations.add(loc);
	}
	
	//This function implemented for compatibility with existing code.  May go away later. - JJM
	public TreeMap<Long, Location> getlocationsAndTimes() {
		TreeMap<Long, Location> locationsAndTimes = new TreeMap<Long, Location>();
		
		Iterator<Location> points = locations.iterator();
		while (points.hasNext())
		{
			Location point = points.next();
			locationsAndTimes.put(point.getTime(), point);
		}
		
		return locationsAndTimes;
	}
}
